﻿using Frame.Lib.Data;
using System;

namespace Frame.Lib.Core.Role
{
    public partial class RoleInfo : EntityBase
    {
        public override string GetTableName()
        {
            return "s_role";
        }
        public override string GetInsertSql()
        {
            return "insert into s_role ( [ID], [Name], [TypeID], [Remark]) values ( @ID, @Name, @TypeID, @Remark)";
        }
        public override string GetUpdateSql()
        {
            return "update s_role set  [Name] = @Name, [TypeID] = @TypeID, [Remark] = @Remark where ID = @ID";
        }
        /// <summary>
        /// 
        /// </summary>
        public Int32 ID
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        public String Name
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        public Int32 TypeID
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        public String Remark
        {
            get;
            set;
        }
        public override void SetValue(string key, object value)
        {
            key = key.ToLower();
            switch (key)
            {
                case "id":
                    this.ID = (Int32)value;
                    break;
                case "name":
                    this.Name = (String)value;
                    break;
                case "typeid":
                    this.TypeID = (Int32)value;
                    break;
                case "remark":
                    this.Remark = (String)value;
                    break;
            }
        }
        public override object GetValue(string key)
        {
            key = key.ToLower();
            switch (key)
            {
                case "id":
                    return this.ID;
                case "name":
                    return this.Name;
                case "typeid":
                    return this.TypeID;
                case "remark":
                    return this.Remark;
                default:
                    return null;
            }
        }
    }

}
